/*
 * $Id: SignalAgent.h,v 1.3 2005-06-28 15:23:58 bacon Exp $
 */

#ifndef _XPP_BAS_SIGNALAGENT_CLASS_
#define _XPP_BAS_SIGNALAGENT_CLASS_

#include <xp/types.h>
#include <xp/macros.h>
#include <xp/bas/signal.h>

namespace xpp
{
	namespace bas
	{
		
		class SignalAgent 
		{
		public:
			SignalAgent ();
			virtual ~SignalAgent ();
		
			int ignoreSignal     (int sig);
			int defaultifySignal (int sig);
			int manageSignal     (int sig);

			int ignoreAllSignals     ();
			int defaultifyAllSignals ();
			int manageAllSignals     ();
			int reapplyAllSigActions ();

			virtual void handleSignal (int sig) {}
		
		protected:
			static SignalAgent* instance;

			static void perform_proc (int sig);
			void perform_proc_two (int sig);
		
			int mask[NSIG + 1];
		};
		
	}
}
#endif
		
